Data Import - supported File Formats
You can import data from several file formats into TPT. These file formats are: A2L, AUTOSAR ARXML, CSV, DAT, DBC, DCM, Intel HEX, LABCAR-SMF, LDF, MAT, MDF, MF4, MON, TPTAIF, TPTBIN, XLSX, XLX, XML. See also Declarations - Import Interface and Import Requirements from CSV or Excel.
TPT can read several types of signals contained in a MAT file type. TPT can also import regular sampled signals.
The MAT file must met the following prerequisites:
- It must contain uniformly sampled signal-vector(s).
- It must contain the scalar variable
StepSize
, representing the sample time in [s].
The following m-script results in two signals, named StepSize = 0.01; foo = 1:10; bar = 1:2:19; save regular_signals StepSize foo bar |
- Each signal needs to be a structure.
- Must include the array
<struct>.t,
containing the time axis. - Must include the array
<struct>.y
, containing the signal data. - The name of the structure will be the imported signal name.
- Signal type is determined through the MATLAB-data type of the stored values.
The following m-script results in two signals foo and bar: foo.t = 0:0.01:0.09; foo.y = 1:10; bar.t = 0:0.01:0.09; bar.y = 1:2:20; save ty_struct foo bar |
- Contains the output of Simulink's "TO WORKSPACE" block.
- The "TO WORKSPACE" block has to be configured to use "Structure with time".
- Contains a matrix
<signals-x-samples>.
- First row contains the time axis.
The following m-script results in two signals matrixsignals =[0:0.01:0.09; 1:10; 1:2:20] save matrix_signals matrixsignals |
- Signal needs to be a structure.
- Must include the array
<struct>.t
, containing the time axis. - Every signal is defined as an array
<struct>.<signalname>
. - Signal type is determined through the MATLAB-data type of the stored values.
The following m-script results in two signals: signalstruct.t = 0:0.01:0.09; signalstruct.foo = 1:10; signalstruct.bar = 1:2:20; save struct_signals signalstruct |
TPT can read the "ControlDesk MATLAB File Format Revision 2.0" format.
A valid CSV file must have:
- A first column (time) to define the time values
- At least one signal column (signal name) to define the signal values
Each column must be separated by a semicolon ";".
Values for structured signals must be separated by a space " ".
time;signal_1;signal_2 1;0;[1 2] 2;1;[6 7] 3;2;[7 8] 4;3;[8 9] |
TPT can read signal data from XLS and XLSX files. The first row must contain the signal names. The first column must contain the time axis. Therefore the first entry (A1) must be named "Time".
The XLSX file either needs to contain only one worksheet or in case of several worksheets the one containing the test data needs to be named "testdata".
You may find that parameters often have prefixes or postfixes when you import data from a DCM file. TPT uses the pattern (\S*_)?(${PARAMETER})(_\S*)?
to search for matching parameters in the file. That means, any prefix or postfix to the parameter is ignored. If you need to change this pattern go to Options | Preferences and select Variables (see Variables). Enter a variable called DCM_NAME_MATCH_PATTERN
and specify a different pattern.
To import parameters from a DCM file (Diagnostic Communication Manager)
- Go to Tools | Convert DCM to TPTAIF.
- Select the DCM file and click Import.
- Click Export to create the TPTAIF file.
You can use the TPTAIF to import the interface. See Declarations - Import Interface for more information.